#pragma once 

#include <iostream>
#include <string>
#include <fstream>

using namespace std;

class Util
{
public:
    static string GetOnLine(string& buffer,const string& sep)
    {
        auto pos = buffer.find(sep);
        if(pos == string::npos)
            return "";
        
        string line = buffer.substr(0,pos);
        // buffer.erase(0,line.size()+sep.size());

        return line;
    }
    static bool readFile(const string& resource,string* out)
    {
        ifstream in(resource);
        if(!in.is_open())
            return false;   // resource not found 
        string line;
        while(getline(in,line))
        {
            *out += line;
        }

        in.close();
        return true;
    }
};
